unit uDataAccessObject;

interface

uses
  Classes, DB;

type
  TDataAccessObject = class(TDataModule)
  protected
    procedure SetConnection; virtual; abstract;
  public
    procedure BeginTransaction; virtual;
    procedure CommitTransation; virtual;
    function ExecuteSQL(AQueryString: string): Boolean; virtual; abstract;
    function GetDataSet: TDataSet; virtual; abstract;
    procedure RollbackTransaction; virtual; 
  end;

implementation

uses uServiceLocator_Intf;

{$R *.dfm}

{ TDataAccessObject }

procedure TDataAccessObject.BeginTransaction;
begin
  ServiceLocator.LogManager.Log('Begin transaction');
end;

procedure TDataAccessObject.CommitTransation;
begin
  ServiceLocator.LogManager.Log('Commit transaction');
end;

procedure TDataAccessObject.RollbackTransaction;
begin
  ServiceLocator.LogManager.Log('Rollback transaction');
end;

end.

